import Vue from 'vue'
import VueRouter from 'vue-router'
import { staticRouter } from "../utils/navData";

// 解决重复点击同一个菜单选项，提示的警告
const originalPush = VueRouter.prototype.push;
VueRouter.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}

Vue.use(VueRouter)

const routes = staticRouter

const router = new VueRouter({
  mode: "hash",
  routes
})

export default router
